import request from '@/utils/request'

// 查询CRM线索池列表
export function listCluePool(query) {
  return request({
    url: '/crm/cluePool/list',
    method: 'get',
    params: query
  })
}

// 查询CRM线索池详细
export function getCluePool(id) {
  return request({
    url: '/crm/cluePool/' + id,
    method: 'get'
  })
}

// 新增CRM线索池
export function addCluePool(data) {
  return request({
    url: '/crm/cluePool',
    method: 'post',
    data: data
  })
}

// 修改CRM线索池
export function updateCluePool(data) {
  return request({
    url: '/crm/cluePool',
    method: 'put',
    data: data
  })
}

// 删除CRM线索池
export function delCluePool(id) {
  return request({
    url: '/crm/cluePool/' + id,
    method: 'delete'
  })
}

export function getCluePoolByNameAndPhone(name, phone) {
  return request({
    url: '/crm/cluePool/' + name + "/" + phone,
    method: 'get'
  })
}

//客户公海抢客户
export function cluePoolToClue(data) {
  return request({
    url: '/crm/cluePool/transferCluePoolToClue',
    method: 'post',
    data: data
  })
}